class: center, middle, inverse, title-slide # Faceting choropleths --- layout: true <div class="dk-footer"> <span> <a href="https://rfortherestofus.com/" target="_blank">R for the Rest of Us </a> </span> </div> --- class: center, middle, dk-section-title background-image:url("https://images.pexels.com/photos/7512498/pexels-photo-7512498.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260") background-size: cover # Faceting choropleths --- # Small multiples .pull-left[ Small multiples is a very popular data visualisation technique. It allows readers to compare data across an additional categorical variable. ] .pull-right[ <center> <img src='images/gg_msleep_faceted.png'/> </center> ] --- <center> <img src='images/gg_msleep_faceted.png'/> </center> --- # Small multiples with {ggplot2} In {ggplot2} we can create small multiples via faceting, with either `facet_wrap()` or `facet_grid()` --- class: my-turn # My turn .pull-left[ I'm going to improve the map from the previous video. Instead of showing one level of educational achievement the chart now shows the % of the population in each category. ] .pull-right[ <center> <img style='background-color:white' src='images/gg_faceted_london_edu.png'/> </center> ] --- class: inverse # Your turn .pull-left[ Recreate this facetted choropleth from the your-turn.R script of `02_08`. - Create a vector containing the correct order of educational attainments - Use fct_relevel() to reorder the facet labels. ] .pull-right[ <img src='images/gg_us_education_attainment.png'/> ]